{extend name="base/index"/}

{block name="page_location"}
<div class="row">
	<div class="col-12">
		<div class="page-title-box">
			<div class="page-title-right">
				<ol class="breadcrumb m-0">
					<li class="breadcrumb-item">
						<a href="{:url('index/index')}">管理中心</a>
					</li>
					<li class="breadcrumb-item active"><i class="iconfont icon-angle-right"></i>信息列表</li>
				</ol>
			</div>
			<h4 class="page-title">
				【{$page_classname}】信息管理
				<a href="{:url('document/publish')}?cid={$page_classid}" class="btn btn-success btn-sm ml-3">发布新的信息</a>
			</h4>
		</div>
	</div>
</div>
{/block}
{block name="body"}
<div class="row" id="document_page">
	<div class="col-12">
		<div class="card">
			<div class="card-body">
				<form class="form-inline" style="margin-bottom:10px;">
					<div class="input-group">
						<div class="input-group-prepend">
							<button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true"
							 aria-expanded="false">选择</button>
							<div class="dropdown-menu" x-placement="bottom-start" style="position: absolute; will-change: transform; top: 0px; left: 0px; transform: translate3d(0px, 37px, 0px);">
								<a href="javascript:;" class="dropdown-item check_select_btn" attr-type="all" attr-bind="check_id">全选</a>
								<a href="javascript:;" class="dropdown-item check_select_btn" attr-type="reverse" attr-bind="check_id">反选</a>
								<a href="javascript:;" class="dropdown-item check_select_btn" attr-type="cancel" attr-bind="check_id">取消</a>
							</div>
						</div>
						<div class="input-group-prepend">
							<button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true"
							 aria-expanded="false">操作选中的</button>
							<div class="dropdown-menu" x-placement="bottom-start" style="position: absolute; will-change: transform; top: 0px; left: 0px; transform: translate3d(0px, 37px, 0px);">
								<a href="javascript:;" class="dropdown-item Fast_Bat" attr-model="{$model_name}" attr-excid="{$page_classid}" attr-type="enable" attr-class=".check_id">启用</a>
								<a href="javascript:;" class="dropdown-item Fast_Bat" attr-model="{$model_name}" attr-excid="{$page_classid}" attr-type="disable" attr-class=".check_id">禁用</a>
								<a href="javascript:;" class="dropdown-item Fast_Bat" attr-model="{$model_name}" attr-excid="{$page_classid}" attr-type="del" attr-class=".check_id">删除</a>
							</div>
						</div>
						<input type="text" name="kw" class="form-control kw enter_goto" attr-event="search_btn" placeholder="搜索:{$search_names}" aria-label="" value="{$kw}" aria-describedby="basic-addon1">
						<div class="input-group-append">
							<button class="btn btn-dark search_btn" type="button" attr-ipt="kw" attr-search-fields="{$search_fields}" attr-cid="{$page_classid}" attr-url="{:url($model_name.'/index')}">搜索</button>
						</div>	
						<a href="javascript:;" class="btn btn-success" id="Fast_Sort" attr-model="{$model_name}" attr-frm="{$model_name}_list_frm">更新排序</a>
					</div>
				</form>
				<div class="table-responsive-md table-responsive-lg ">
					<form action="" method="post" id="{$model_name}_list_frm">
						<table class="table table-centered mb-0">
							<thead>
								<tr>
									<th>ID</th>
									{volist name="fields_title" id="field"}
									<th>{$field}</th>
									{/volist}
									<th>操作</th>
								</tr>
							</thead>
							<tbody>
								{volist name='list' id="data"}
								<tr>
									{volist name='data.data' id="d"}
									{switch name="d.type"}
									{case value="id"}
									<td>
										<div class="custom-control custom-checkbox">
											<input type="checkbox" class="custom-control-input check_id" id="check_id{$d.value}" value="{$d.value}" name="check_id[]">
											<label class="custom-control-label" for="check_id{$d.value}">ID:{$d.value}</label>
										</div>										
										<input type="hidden" name="classid_sel" value="{$page_classid}" />
										<input type="hidden" name="field_ids[]" value="{$d.value}">
									</td>
									{/case}
									{case value="orderid"}
									<td>
										<input type="number" class="form-control orderid_ipt" name="orderid_ipt[]" value="{$d.value}">
									</td>
									{/case}									
									{case value="class"}
									<td><span class="label label-info">{$d.value|ReStrLen=6,'...'}</span></td>
									{/case}
									{case value="text"}
									<td>
										{$d.value|ReStrLen=15,'...'}
									</td>
									{/case}
									{case value="single_image"}
									<td><a href="javascript:;"><img class="list_facepic preview_img" src="{$d.value|default='/static/admin/images/nopic.png'}" alt=""/></a></td>
									{/case}
									{case value="single_file"}
									<td><a href="{$d.value}" target="_blank">点击下载</a></td>
									{/case}
									{case value="single_media"}
									<td><a href="{$d.value}" target="_blank">点击下载</a></td>
									{/case}
									{case value="color"}
									<td>
										<div class="colorbox alert" style="background-color:{$d.value}">{$d.value}</div>
									</td>
									{/case}
									{case value="radio"}
									<td><span class="badge badge-primary">{$d.value}</span></td>
									{/case}
									{case value="checkbox"}
									<td>
										{volist name="d.value" id="v"}
										<span class="badge badge-primary">{$v}</span>
										{/volist}
									</td>
									{/case}
									{default /}
									<td>{$d.value}</td>
									{/switch}
									{/volist}
									<td>
										<a href="{:url('document/publish')}?act=edit&cid={$page_classid}&id={$data.id}" class="btn btn-primary btn-sm doc_edit_btn"><i class="iconfont icon-icon_compile"></i>修改信息</a>
										<a href="javascript:;" attr-id="{$data.id}" class="btn btn-danger btn-sm Fast_Del" attr-model="{$model_name}" attr-excid="{$page_classid}"><i class="iconfont icon-icon_delete_fill"></i>删除</a>
									</td>
								</tr>
								{/volist}
							</tbody>
						</table>
					</form>
					<div class="pagination pagination-small txtcenter">
						{$pagelist}
					</div>
				</div>
				<!-- end table-responsive-->
			</div>
			<!-- end card body-->
		</div>
		<!-- end card -->
	</div>
	<!-- end col-->
</div>
<!-- END PAGE CONTENT-->
{/block}
